﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApp4
{
    class Computer
    {
        private string brand;
        private IUSB uSB1;
        private IUSB uSB2;
        public string Brand
        {
            get { return this.brand; }
            set { this.brand = value; }
        }
        public IUSB Usb1
        {
            get { return this.uSB1; }
            set { this.uSB1 = value; }
        }
        public IUSB Usb2
        {
            get { return this.uSB2; }
            set { this.uSB2 = value; }
        }
        public Computer(string brand,IUSB uSB1,IUSB uSB2)
        {
            Brand = brand;
            Usb1 = uSB1;
            Usb2 = uSB2;
        }
        public void Open()
        {
            Console.WriteLine("{0}电脑打开中...",brand);
        }
        public void Read()
        {
            this.Usb1.Read();
            this.Usb2.Read();
        }
        public void Write()
        {
            this.Usb1.Write();
            this.Usb2.Write();
        }
        public void Close()
        {
            Console.WriteLine("{0}电脑关闭中...",brand);
        }
        public Computer()
        {

        }
    }
}
